package com.thiswhyme.demo.msgpush.core.impl.nio.event;

import com.thiswhyme.demo.msgpush.core.event.AbstractCloseEventWsHandler;
import com.thiswhyme.demo.msgpush.core.event.bean.WebSocketEvent;
import com.thiswhyme.demo.msgpush.core.impl.nio.ChannelManager;
import lombok.extern.slf4j.Slf4j;

/**
 * @description: WebSocket连接关闭事件处理器-nio
 * @author: thiswhyme
 * @date: 2021/9/28
 */
@Slf4j
public class CloseEventNioHandler  extends AbstractCloseEventWsHandler {

    @Override
    public void doHandle(WebSocketEvent event) {
        event.getIdentifiers().forEach(ChannelManager::removeAndClose);
    }
}
